package org.tang.hool.webmvc;

import java.util.Map;

/**
 * 封装页面模版和往页面模版传递的返回参数对应关系
 *
 * @author Tang Jiujia
 * @since 2022/5/5
 */
public class ModelAndView {
    /**
     * 页面模版名
     */
    private String viewName;

    /**
     * 往页面模版传递的参数
     */
    private Map<String, ?> model;

    public ModelAndView(String viewName, Map<String, ?> model) {
        this.viewName = viewName;
        this.model = model;
    }

    public ModelAndView(String viewName) {
        this(viewName, null);
    }

    public String getViewName() {
        return viewName;
    }

    public void setViewName(String viewName) {
        this.viewName = viewName;
    }

    public Map<String, ?> getModel() {
        return model;
    }

    public void setModel(Map<String, ?> model) {
        this.model = model;
    }
}
